import request from '@/utils/request'

/**
 * 系统基础[消息列表]
 */
export function useBaseMsgApi() {
  return {
    /**
     * 获取我的消息列表
     * @param data
     * @constructor
     */
    PostBaseMessages: async (data?: object) => {
      return request({
        url: '/api-base/Msg/user_messages',
        method: 'post',
        data
      })
    },

    /**
     * 将用户的未读消息全部标记为已读
     * @constructor
     */
    PutBaseMessagesRead: async () => {
      return request({
        url: '/api-base/Msg/user_messages_readed',
        method: 'put'
      })
    },

    /**
     * 获取我的未读消息总数
     * @constructor
     */
    GetBaseMessagesRead: async () => {
      return request({
        url: '/api-base/Msg/user_messages_unreadcount',
        method: 'get'
      })
    }
  }
}
